<?php
namespace App\Transformers;

use App\Models\Category;
use App\Models\Write;
use League\Fractal\TransformerAbstract;

class CategoryTransformer extends TransformerAbstract
{
//    protected $availableIncludes=['write','datas'];
    public function transform(Category $category){
        return [
            'id'         =>$category->id,
            'cate_name'      =>$category->cate_name,
//            'name'     =>$category->name,
//        'categories' =>Write::find($category->id),
            'created_at' =>$category->created_at,
//            'updated_at' =>$user->updated_at

        ];
    }
}

